<?php
class M_baigiang extends CI_Model{
	public function __construct()
	{
		parent::__construct();
		// Your own constructor code
	}
    public function get_select_baigiang($id)
    {
           
        $this->db->select('*');
        $this->db->from('khoahoc');
        $this->db->join('baigiang', 'khoahoc.id = baigiang.id_khoahoc');
        $this->db->where('khoahoc.id',$id);
        $result = $this->db->get();
        return $result;
        $result->free_result();
    }
    public function select_mon1($id)
    {
        $this->db->select('*');
        $this->db->from('mon');
        $this->db->join('khoahoc', 'mon.id = khoahoc.id_mon');
        $this->db->where('mon.id',$id);
        $result = $this->db->get();
        return $result;
        $result->free_result();
    }
    public function select_mon($id)
    {
        $this->db->select('khoahoc.tenkhoahoc');
        $this->db->from('khoahoc');
        $this->db->join('mon', 'mon.id = khoahoc.id_mon');
        $this->db->where('mon.id',$id);
        $result = $this->db->get();
        return $result;
        $result->free_result();
    }
 }